<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageContent">
	<form method="post" action="${pageContext.request.contextPath}${requestScope.record ==null ?'/investment/investment/insert' :'/investment/investment/update' }" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
		<div class="pageFormContent" layoutH="56">
			<!-- 关闭窗口 -->
			<input type="hidden" name="callbackType" value="closeCurrent" />
			<!-- 隐藏表单 -->

			<c:if test="${requestScope.record !=null}">
				<input type="hidden" name="id" value="${requestScope.record.id}" />
			</c:if>
			<p>
				<label>姓名</label> <input name="name" class="required" maxlength="20" type="text" value="${requestScope.record.name}" />
			</p>
			<p>
				<label>性别</label> <input name="sex" class="required" type="radio" value="1" checked="checked" />男 <input name="sex" class="" type="radio" value="0" />女
			</p>
			<p>
				<label>电话</label> <input name="phone" class="required" maxlength="11" type="text" value="${requestScope.record.phone}" />
			</p>
			<p>
				<label>其他联系方式</label> <input name="other" class="" maxlength="11" type="text" value="${requestScope.record.other}" />
			</p>
			<%-- <p>
				<label>日期</label> <input type="text" name="date" class=" date textInput readonly" datefmt="yyyy-MM-dd" readonly="true" value="<fmt:formatDate value='${requestScope.record.date}' pattern='yyyy-MM-dd'/>" /><a class="inputDateButton" href="javascript:;">选择</a>
			</p> --%>
			<p>
				<label>时间</label> <input type="text" name="time" class=" date textInput readonly" datefmt="yyyy-MM-dd HH:mm:ss" readonly="true" value="<fmt:formatDate value='${requestScope.record.time}' pattern='yyyy-MM-dd HH:mm:ss'/>" /><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
			<p>
				<label>客户来源</label> <input name="source" class="" maxlength="100" type="text" value="${requestScope.record.source}" />
			</p>
			<p>
				<label>客户意向</label>
				<select name="intent" class="combox">
					<option value="" selected="selected">请选择</option>
					<option value="A" ${requestScope.record.intent == 'A' ? "selected":""}>A</option>
					<option value="B" ${requestScope.record.intent == 'B' ? "selected":""}>B</option>
					<option value="C" ${requestScope.record.intent == 'C' ? "selected":""}>C</option>
					<option value="D" ${requestScope.record.intent == 'D' ? "selected":""}>D</option>
				</select>
			</p>
			<p>
				<label>跟进人</label> 
				<select name="maid" class="combox">
					<option value="">请选择</option>
					<c:forEach items="${requestScope.mEmployees}" var="EmployeesItem">
						<option value="${EmployeesItem.employeeId}" ${EmployeesItem.employeeId == requestScope.record.maid?'selected':''}>${EmployeesItem.employeeName}</option>
					</c:forEach>
				</select>
			</p>
			<p>
				<label>下一次跟进时间</label> <input type="text" name="ntfw" class=" date textInput readonly" ${requestScope.record.ntfw !=null?'disabled':''} datefmt="yyyy-MM-dd" readonly="true" value="<fmt:formatDate value='${requestScope.record.ntfw}' pattern='yyyy-MM-dd'/>" /><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
			<p class="nowrap" style="width: 585px;">
				<label>地址（省&市/区）</label> <input type="hidden" name="areaName" value="${requestScope.record.areaName}" /> 
				<select class="combox required" name="areaCode" id="investment_combox_province" ref="investment_combox_city" refUrl="${pageContext.request.contextPath}/system/areas/getCityByProvince?id={value}" default-value="110000">
					<c:if test="${requestScope.province==null}">
						<option value="">请选择省份</option>
					</c:if>
					<c:forEach items="${requestScope.provinces}" var="item">
						<option value="${item.id}" ${item.id==requestScope.province?"selected":""}>${item.name}</option>
					</c:forEach>
				</select> <select class="combox required" name="areaCode" id="investment_combox_city" ref="investment_combox_region" refUrl="${pageContext.request.contextPath}/system/areas/getCountyByAreas?id={value}" default-value="110100">
					<c:if test="${requestScope.city==null}">
						<option value="">请选择城市</option>
					</c:if>
					<c:forEach items="${requestScope.citys}" var="item">
						<option value="${item.id}" ${item.id==requestScope.city?"selected":""}>${item.name}</option>
					</c:forEach>
				</select> <select class="combox required" name="areaCode" id="investment_combox_region" default-value="110100">
					<c:if test="${requestScope.county==null}">
						<option value="">请选择市区</option>
					</c:if>
					<c:forEach items="${requestScope.countys}" var="item">
						<option value="${item.id}" ${item.id==requestScope.county?"selected":""}>${item.name}</option>
					</c:forEach>
				</select>
			</p>
			<p>
				<label>招商类型</label> <select name="type" class="combox">
					<option value="">请选择</option>
					<c:forEach items="${requestScope.itmtTypes}" var="item">
						<option value="${item.id }" ${requestScope.record.type == item.id?'selected':''}>${item.val }</option>
					</c:forEach>
				</select>
			</p>
			<p>
				<label>备注1</label> <input name="remk1" class="" maxlength="200" type="text" value="${requestScope.record.remk1}" />
			</p>
			<p>
				<label>备注2</label> <input name="remk2" class="" maxlength="200" type="text" value="${requestScope.record.remk2}" />
			</p>
			<p>
				<label>备注3</label> <input name="remk3" class="" maxlength="200" type="text" value="${requestScope.record.remk3}" />
			</p>
			<p>
				<label>备注4</label> <input name="remk4" class="" maxlength="200" type="text" value="${requestScope.record.remk4}" />
			</p>
			<p>
				<label>备注5</label> <input name="remk5" class="" maxlength="200" type="text" value="${requestScope.record.remk5}" />
			</p>


		</div>
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div></li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
	</form>
</div>
<script type="text/javascript">
	$(".combox").change(function() {
		$("ul,li,a").find("[value='all']").remove();
		var province = $("#investment_combox_province").find("option:selected").text();
		var city = $("#investment_combox_city").find("option:selected").text();
		var region = $("#investment_combox_region").find("option:selected").text();
		$("[name='areaName']").val(province + "," + city + "," + region);
	});
</script>